package com.cloudbroker.bcs.platform.dav.middle.service.base;

import org.springframework.scheduling.annotation.Async;

import com.cloudbroker.bcs.common.entity.Markable;
import com.cloudbroker.bcs.common.entity.Pageable;
import com.cloudbroker.bcs.common.service.base.ServiceImplBase;
import com.cloudbroker.bcs.platform.dav.common.config.ConfigValues;

public abstract class MycatServiceImplBase<T extends Pageable, K> extends ServiceImplBase<T, K> {
    
    @Override
    public void save(T entity) {
        if (entity instanceof Markable) {
            Markable markable = (Markable) entity;
            markable.setMycat_flag(ConfigValues.getMycatFlag());
        }
        super.save(entity);
    }
    
    @Override
    @Async
    public void update(T entity) {
        super.update(entity);
    }
    
    @Override
    public void delete(K key) {
        super.delete(key);
    }
}
